﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; 
using NTTDATA.BEENChina.ResultCertification.Config; 

namespace NTTDATA.BEENChina.ResultCertification.Checker.Select
{

    /// <summary>
    /// 文字栏＿无(有)记载
    /// </summary>
    [Serializable]
    [VerfityAttribute(Id = "VerfityS0200", Name = "文字栏无(有)记载时抽出（包括？）", CategoryType = EnumCategoryType.选择, Model = true)]
    public class VerfityS0200 : VerfityOneResult
    {
       
        public bool _entryResultEmpty = false;

        /// <summary>
        /// 
        /// </summary>
        [Category("未(有)记载"), Description("true:结果不是空抽出，false:录入结果空抽出")]
        public bool EntryResultEmpty
        {
            get { return _entryResultEmpty; }
            set { _entryResultEmpty = value; }
        }

        public override bool CheckResult(List<List<string>> result, string entryCommon)
        {
            bool bresult = false;

            if (entryCommon == "30"  )
            {
                return false;
            }

            if (result == null)
            {
                return false;
            }


            bresult = CheckSpecificRowIsEmpty(result, GetSpeicficResult, _entryResultEmpty,-1,-1); 

           

            if (bresult)
            {
                System.Console.WriteLine("VerfityS0200");
            }

            return bresult;
        }


        private string GetSpeicficResult(string colResult)
        {
            var splitResult = new Split.SplitEntryResult(ChildImageObject.CategorySetting.DataFormat, colResult);
            if (ChildImageObject.CategorySetting.DataFormat.Contains("tx"))
            {
                return splitResult.GetText();
            }
            

            return colResult;
        }


      
       


    }
}
